<?php
$cache = new smallCache(ROOT_PATH.'/temp/cache');
if(!$classes = $cache->get('classes'))
{
    //echo '41414';
    $sql = "select * from class";
    $rs = $db1->query($sql);
    while($row = $rs->fetch())
    {
        $classes[$row[c_name]] = $row;
        $opt_classes[$row[c_name]] = $row['c_name'];
    }
    $cache->set('classes', $classes);
    $cache->set('opt_classes', $opt_classes);
    //echo '41414';
}
else
{
    $opt_classes = $cache->get('opt_classes');
}

if(!$opt_races = $cache->get('opt_races'))
{
    $sql = "select * from races where stand='$config[stand]'";
    $rs = $db1->query($sql);
    while($row = $rs->fetch())
    {
        $opt_races[$row[race]] = $row[race];
    }
    $cache->set('opt_races', $opt_races);

}

if(!$opt_dkp = $cache->get('opt_dkp'))
{
    $rs = $db1->query("select d_id,d_name,d_icon from dkptype where d_close=0 order by d_id desc");
    while($row = $rs->fetch())
    {
        $opt_dkp[$row[d_id]] = $row['d_name'];
        $dkps[$row[d_id]] = $row;
    }
    $cache->set('opt_dkp', $opt_dkp);
    $cache->set('dkps', $dkps);
}
else
{
    $dkps = $cache->get('dkps');
}

if(!$opt_rules = $cache->get('opt_rules'))
{
    $sql = "select ru_id,ru_name from rules";
    $rs = $db1->query($sql);
    while($row = $rs->fetch())
    {
        $opt_rules[$row[ru_id]] = $row['ru_name'];
    }
    $cache->set('opt_rules', $opt_rules);
}

?>